import request from '@/config/axios'

// 软件更新记录 VO
export interface SoftwareUpdateLogVO {
  id: number // 记录ID
  softwareId: number // 软件ID
  version: string // 更新版本
  content: string // 更新内容
}

// 软件更新记录 API
export const SoftwareUpdateLogApi = {
  // 查询软件更新记录分页
  getSoftwareUpdateLogPage: async (params: any) => {
    return await request.get({ url: `/compo/software-update-log/page`, params })
  },

  // 查询软件更新记录详情
  getSoftwareUpdateLog: async (id: number) => {
    return await request.get({ url: `/compo/software-update-log/get?id=` + id })
  },

  // 新增软件更新记录
  createSoftwareUpdateLog: async (data: SoftwareUpdateLogVO) => {
    return await request.post({ url: `/compo/software-update-log/create`, data })
  },

  // 修改软件更新记录
  updateSoftwareUpdateLog: async (data: SoftwareUpdateLogVO) => {
    return await request.put({ url: `/compo/software-update-log/update`, data })
  },

  // 删除软件更新记录
  deleteSoftwareUpdateLog: async (id: number) => {
    return await request.delete({ url: `/compo/software-update-log/delete?id=` + id })
  },

  // 导出软件更新记录 Excel
  exportSoftwareUpdateLog: async (params) => {
    return await request.download({ url: `/compo/software-update-log/export-excel`, params })
  },
}